package com.dayangxiaoen.pms.controller;

import com.dayangxiaoen.pms.dto.UserDTO;
import com.dayangxiaoen.pms.service.UserService;
import com.dayangxiaoen.pms.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dayangxiaoen
 *
 * 用户登录控制类
 *
 */

@RestController
@RequestMapping("login")
@Slf4j
public class LoginController {

    @Autowired
    private UserService userService;

    @PostMapping
    public Result login(@RequestBody UserDTO userDTO){
        // TODO 登录 验证用户 访问用户表
        return userService.login(userDTO);
    }
}
